﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace MyFirsthThread
{
    class Program
    {
        static void Main(string[] args)
        {
            Thread t1 = new Thread(new ThreadStart(Thread1));
            Thread t2 = new Thread(new ThreadStart(Thread2));
            t1.Start();
            t2.Start();
            Thread.Sleep(500);
            t1.Abort();
            t2.Abort();
            Console.ReadLine();
        }

        static void Thread1()
        {
            int count = 0;
            while (count < 100)
            {
                count++;
                Console.WriteLine("Hello!");
            }
        }

        static void Thread2()
        {
            int count = 0;
            while (count < 100)
            {
                count++;
                Console.WriteLine("World!");
            }
        }
    }
}
